<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
<div id="app">
    <h1>{{num}}</h1>
    <input type="text" v-model="num">
</div>
</body>

</html>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
    //v-model是一个用于双向变更数据内容和视图内容的指令

    //但凡是写业务,如果看到结构中有input:type='text' 肯定要加v-model
    let vm = new Vue({
        data: {
            num: 30
        }
    }).$mount('#app')
</script>